<?php
session_start();
require_once 'php_includes.php';

//make sure it is a manager logged on
checkManager();


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
    <title>Payroll and Timesheet Management Website</title>
    <link rel="stylesheet" type="text/css" href="styles.css"/>
	<script type="text/javascript" src="pwcheck.js">
	</script>
  </head>
  <body>
  
	<?php writeHeader(); ?>
        <?php  //Get data values
          $employee = $_POST["Employees"];
          $check = $_POST["hide"];
          $manager = $_POST["Managers"];
          if($check != check)
          {
            echo "<p> Transaction invalid. </p>";
            echo "<p><a href='changeManager.php'>Go back to Change Employee's Manager</a></p>";
          }
          else
          {
            sqlConnect();
            $getId = "UPDATE Employee SET ManagerID = '$manager' WHERE EmployeeID = '$employee' ;";
            $result = sqlQuery($getId);
            sqlExit();
            echo "<p> Your transaction was successfully. </p>";
            echo "<p><a href='changeManager.php'>Go back to Change Employee's Manager</a></p>";
          }
        ?>
</body>
</html>
	